package com.imcode;

import java.io.*;

/**
 * 字符字节转换流输出流
 * 建立字符到字节之间的桥梁  编码   看的懂的-->看不懂的
 *
 */
public class OutputStreamWirterDemo {

    public static void main(String[] args) throws IOException {
        //1.创建一个字符字节输出流的对象
        //Writer osw = new OutputStreamWriter(new FileOutputStream("file/2_GBK.txt"));
        Writer osw = new OutputStreamWriter(new FileOutputStream("file/2_GBK.txt"),"GBK");
        //2.先文件写入内容
        osw.write("大家好才是真的好");
        //3.关闭流
        osw.close();
    }
}
